<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 spam_assassin.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
$page_title = "Spam Assassin";
include $root_path.'common.php';
include $root_path.'page_header.php';


// We have a check to see if spamassassin is installed first. We'll die if it isn't.

$spam_assassin = <<<EOF
<cpanelif !$conf{'skipspamassassin'} $CPDATA{'FEATURE-SPAMASSASSIN'}><cpanelfeature spamassassin>test</cpanelfeature></cpanelif>
EOF;

if (empty($spam_assassin)) {
	message_die('Spam Assassin is not enabled on this server. Please contact your systems administrator if you think it should be.');
}


$spam_status = <<<EOFpacman
<cpanel Email="spamstatus()">
EOFpacman;

// Why have both enable and disable buttons displayed at the same time? Just switch them!
if ($spam_status == "enabled") {
	$template->assign_block_vars('switch_spam_assassin_disable', array());
} else {
	$template->assign_block_vars('switch_spam_assassin_enable', array());
};

$spam_box_status = <<<EOFpacman
<cpanel Email="spamboxstatus()">
EOFpacman;

// And again...
if ($spam_box_status == "enabled") {
	$template->assign_block_vars('switch_spam_box_disable', array());
} else {
	$template->assign_block_vars('switch_spam_box_enable', array());
};

$template->set_filenames(array(
	'body' => $root_path.$template_path.'mail/spam_assassin.tpl')
);


$template->assign_vars(array(
	'S_ACTION' => "trace_show_route.php",
	'SPAM_ASSASSIN_STATUS' => $spam_status,
	'SPAM_BOX_STATUS' => $spam_box_status,
	'U_SPAM_ENABLE' => 'spam_assassin_enable_done.php',
	'U_SPAM_DISABLE' => 'spam_assassin_disable_done.php',
	'U_SPAM_BOX_ENABLE' => 'spam_box_enable_done.php',
	'U_SPAM_BOX_DISABLE' => 'spam_box_disable_done.php',
	'U_SPAM_CONFIG' => 'spam_assassin_config.php',
));

//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';


?>